<div class="tabbable tabs-left apm-nav-tabs-left">
	<ul class="nav nav-tabs business-detail-nodedetail-tabs">
		<li class="active"><a href="#businessDetailconfigTab1">基本配置</a></li>
		<li><a href="#businessDetailconfigTab2">告警配置</a></li>
	</ul>
	<div class="tab-content">
		<div id="businessDetailconfigTab1" class="form-horizontal tab-pane fade in active">
			<fieldset>
				<div {{bind-attr class=":alert alertType businessformTip::hide"}}><strong>{{businessformTip}}</strong></div>
				<h4>基本配置</h4>
				<div class="control-group">
					<label class="control-label">名称:</label>
					<div class="controls">
						{{input class="input span6" value=form.name maxlength="20"}}
					</div>
				</div>
			</fieldset>
			<fieldset>
				<h4>应用性能体验参数</h4>
				<div class="control-group">
					<label class="control-label">Apdex T:</label>
					<div class="controls">
						{{input class="input span6" value=form.apdex_t}} <span style="color:#6ac5fe;">秒</span>
							<p style="color:#ffffff; margin-top:10px; margin-bottom:0;">Apdex T 代表用户对应用性能满意的响应时间界限。如0.5秒，满意区间就是 0~0.5 秒；下一个区间“容忍”的界限值则是 T 和 4T，即 1~2 秒之间为容忍区间；最后一个区间“失望”的响应时间则大于 4T，即多于 2 秒。</p>
					</div>
				</div>
			</fieldset>
			<fieldset>
				<h4>访问地图设置</h4>
				<div class="control-group">
					<label class="control-label">地图:</label>
					<div class="controls" style="position:relative;">
						{{view view.AreaSelect areaCode=form.areaCode}}
					</div>
				</div>
			</fieldset>
			<fieldset>
				<h4>设置告警时间</h4>
				<div class="control-group">
					<label class="control-label">时间:</label>
					<div class="controls clearfix">
						{{view view.AlarmTime 
							alarmStartTime=alarmStartTime
							alarmEndTime=alarmEndTime
							isAll=isAll
							dateSelect="dateSelectClick"
						}}
					</div>
				</div>
			</fieldset>
			<fieldset style="border-bottom:none; padding-top:10px;">
				<div class="control-group">
					<label class="control-label"></label>
					<div class="controls">
						<button class="btn btn-primary" {{action "updateAlarmTime"}}>保存</button>
						<button class="btn" {{action "cancelAlarmTime"}}>取消</button>
					</div>
				</div>
			</fieldset>

		</div>
		<div id="businessDetailconfigTab2" class="form-horizontal tab-pane">
			<fieldset style="border-bottom:none;">
				<div class="control-group" style="margin:16px 0;">
					<label class="control-label"><button class="btn btn-primary btn-large" {{action "addThreshold"}}>添加</button></label>
				</div>
				<div class="control-group">
					<table class="conf-table conf-iprepair-tab business-detail-config-alarm">
						<thead>
							<tr>
								<th>对象</th>
								<th>指标</th>
								<th>
									告警条件
									<span class="label label-small label-danger">严重</span>
									<span class="label label-small label-warning">警告</span>
									<span class="label label-small label-info">提醒</span>
								</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody>
							{{#each thresholds as |threshold|}}
							<tr>
								<td>
									{{threshold.targetName}}
								</td>

								<td>
									{{#each threshold.thresholdParam as |tsparam|}}
										{{#if tsparam.indexName}}
											<div style="line-height:32px;">{{tsparam.indexName}}</div>
										{{else}}
											<div style="line-height:32px;">{{tsparam.indicatorName}}</div>
										{{/if}}
									{{/each}}
								</td>

								<td>
									{{#each threshold.thresholdParam as |tsparam|}}
										<div style="line-height:32px;">
										{{#if tsparam.level_50}}<span class="label label-danger">{{tsparam.operator}} {{tsparam.level_50}}</span>{{/if}}
										{{#if tsparam.level_20}}<span class="label label-warning">{{tsparam.operator}} {{tsparam.level_20}}</span>{{/if}}
										{{#if tsparam.level_10}}<span class="label label-success">{{tsparam.operator}} {{tsparam.level_10}}</span>{{/if}}
										</div>
									{{/each}}
								</td>

								<td>
									<button class="btn btn-primary" {{action "showThresholdsDiaolg" threshold}}>编辑</button>
									<button class="btn btn-danger" {{action "deleteThreshold" threshold}}>删除</button>
								</td>
							</tr>
							{{/each}}
						</tbody>
					</table>
				</div>
			</fieldset>
		</div>
	</div>
</div>

{{view view.ThresholdConfig
	id="businessConfigThresholdView"
	targetResource=curEditeThreshold
	thresholdForm=thresholdForm
	tradingForm=thresholdForm
	isShowSystem=isShowSystemOrBusiness
	isConfig=true
	alarmTime=alarmTimeSlot
	appId=business.id}}